//
//  UIImage+Resize.m
//  Teacher
//
//  Created by 洋 耿 on 15/3/25.
//  Copyright (c) 2015年 ZengYuan. All rights reserved.
//

#import "UIImage+Resize.h"

@implementation UIImage (Resize)
/**
 *  返回一张可以随意拉伸不变形的图片
 *
 *  @param name 图片名字
 */
+ (UIImage *)resizableImage:(NSString *)name
{
    UIImage *image = [self imageWithName:name];
    
    return [image stretchableImageWithLeftCapWidth:image.size.width * 0.5 topCapHeight:image.size.height * 0.5];
}

+ (UIImage *)imageWithName:(NSString *)name{
    
    
    return [UIImage imageNamed:name];
}

+ (UIImage *)resizedWithName:(NSString *)name{
    UIImage *image = [self imageWithName:name];
    
    return [image stretchableImageWithLeftCapWidth:image.size.width * 0.5 topCapHeight:image.size.height * 0.5];
}
@end
